import service from "@/service";

//查询【超管账号下拉框】
export function getSuperTenant(userName) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant/getUserData?userName=${userName}`,
    method: "POST",
  });
}

//查询【包含系统下拉框】
export function getIncludeSystem() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-system/getSystemList`,
    method: "GET",
  });
}

//文件上传
export function userCenterFile(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-file/uploadFileFile`,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}

//查询【租户管理列表】
export function getTenantManageList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant/getListData?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//【租户管理新增】
export function getTenantManageAdd(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant/saveOrUpdateData`,
    method: "POST",
    data,
  });
}

//查询【租户管理详情】
export function getTenantDetails(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant/getDetail?id=${id}`,
    method: "POST",
  });
}

//【删除租户】
export function getTenantDelete(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant/deleteData?id=${id}`,
    method: "POST",
  });
}

//查询【租户菜单列表】
export function getTenantPermissionList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant-permission/getListData`,
    method: "POST",
    data,
  });
}

//【租户菜单目录新增】
export function getTenantPermissionMLAdd(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant-permission/saveOrUpdateML`,
    method: "POST",
    data,
  });
}

//查询【租户菜单详情】
export function getTenantPermissionDetails(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant-permission/getDetail?id=${id}`,
    method: "POST",
  });
}

//编辑【租户菜单】
export function getTenantUpdate(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant-permission/updateData`,
    method: "POST",
    data,
  });
}

//【租户菜单子节点新增】
export function getTenantPermissionZJDAdd(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant-permission/saveOrUpdateZJD`,
    method: "POST",
    data,
  });
}

//【删除租户菜单】
export function getTenantPermissionDelete(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant-permission/deleteData?id=${id}`,
    method: "POST",
  });
}

//查询【上级目录下拉框】
export function getParentDirectory(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant-permission/getMLListData`,
    method: "POST",
    data,
  });
}

//查询【参考项目下拉框】
export function getConsultTenant(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant-permission/getCopyTenant`,
    method: "POST",
    data,
  });
}

//【引用租户菜单新增】
export function getTenantPermissionYYAdd(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-tenant-permission/saveOrUpdateYY`,
    method: "POST",
    data,
  });
}
